home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6338 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: newsserver.amsinc.com!usenet
  2. From: Chris Corry <christopher_corry@mail.amsinc.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Number class
  5. Date: Thu, 08 Feb 1996 18:40:03 -0500
  6. Organization: American Management Systems, Inc.
  7. Message-ID: <311A89D3.562A@mail.amsinc.com>
  8. NNTP-Posting-Host: ccorry.amsinc.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  13.  
  14. I seem to remember reading some years back (I believe in C++ Report)
  15. about how writing a Number class with complete number semantics (i.e.,
  16. all operator support - including precedence) was much more difficult
  17. than it initially appears (I seem to recall the word "impossible").
  18. With the exception that you couldn't use array initializers a la:
  19.  
  20.     // Works fine for ints but illegal for C++ classes
  21.     MyNumber  NumArray[] = { 45, 34, 56, 89 };
  22.  
  23. what other reasons can you think of for trying to write a number class?
  24. I've just spent several hours in a design meeting arguing that it's a
  25. Real Bad Idea and couldn't come up with better reasons off the top of
  26. me head.
  27.  
  28. Thanks all,
  29.  
  30. - Chris
  31.  
  32.  
  33. Chris Corry
  34.